import { onLoad } from "@dcloudio/uni-app"
import { ref } from "vue";
import { objectAny } from "../../options/base";
import { getNoticeList } from "../../utils/common/notice_api";
import moment from 'moment';
import { goToPage } from "../../utils/utils";

export default {
    setup() {
        const noticeList=ref<Array<objectAny>>([])

        onLoad(async ()=>{
            noticeList.value=await getNoticeList();
        })

        function formatTime(timeMs:number){
            return moment(timeMs).format(`YYYY/MM/DD`)
        }


        return {
            noticeList,
            goToPage,
            formatTime
        }
    }
}